#ifndef DEVVIDEO_H
#define DEVVIDEO_H

#include <linux/videodev2.h>
#include "platform.h"

typedef struct DevVideo {
                    const char* node;
                            int handle;
                        Buffer* buffer;
                   unsigned int bufferNumber;
             struct v4l2_format vfmt;
                            int isStreamOn;
} DevVideo;

typedef struct DevVideoConfig {
                    const char* node;
                   unsigned int bufferNumber;
                            int input;
                            int output;
               struct v4l2_crop vcrop;
             struct v4l2_format vfmt;
} DevVideoConfig;

extern int DevVideo_initialize(DevVideo *dev, DevVideoConfig *devConfig);

extern int DevVideo_uninitialize(DevVideo *dev);

extern inline int DevVideo_streamOn(DevVideo *dev);

extern inline int DevVideo_streamOff(DevVideo *dev);

extern inline int DevVideo_dqBuffer(DevVideo *dev, struct v4l2_buffer *buffer);

extern inline int DevVideo_qBuffer(DevVideo *dev, struct v4l2_buffer *buffer);

#endif // DEVVIDEO_H
